package com.content.controller;

import com.content.service.config.MultipartSupportConfig;
import com.content.service.feignclient.MediaServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;

@RestController
@RequestMapping("/upload")
public class ddd {

    @Autowired
    MediaServiceClient mediaServiceClient;
    @PostMapping("/test")
    public String test() {
        MultipartFile multipartFile = MultipartSupportConfig.getMultipartFile(new File("D:\\test.html"));
        mediaServiceClient.uploadFile(multipartFile, "course/test.html");
        return "success";
    }
}
